﻿@model Romantics.Domain.Objects.Hike
@using Romantics
@{
    ViewBag.Title = Model.Name;

    var Action = ((string)ViewContext.RouteData.Values["Action"]);
    var Controller = ((string)ViewContext.RouteData.Values["Controller"]);
}
@section RenderMeta{
    <meta name="description" content="@Model.Options.MetaDescription"/>
    <meta name="author" content="@Model.Options.Author"/>
    @{
        var meta = Model.Meta ?? Model.Options.MetaKeywords;
        <meta name="keywords" content="@meta" />
    }
}
<div id="content">
    <div class="post">
        <div class="post-meta">
            <div class="row">
                <div class="post-title">
                    <h1>@Html.HikeLink(Model)</h1>
                </div>
            </div>
            <!-- AddThis -->
            <div class="share-links">
                @Html.Partial("_AddThis")
            </div>
            <div class="row">
                <div class="post-category">
                    <span>Катогория:&nbsp;</span>@Html.CategoryLink(Model.Category, Controller)
                </div>
                <div class="post-category">
                    <span>Регион:&nbsp;</span>@Html.RegionLink(Model.Region, Controller)
                </div>
                <!-- DISPLAY THE COMMENTS COUNT -->
                <div class="no-of-comments">
                    <a href="@string.Format("{0}#disqus_thread", Model.Href(Url))"></a>
                </div>
            </div>
            <div class="row">
                <span>Маршрут:&nbsp;</span>@Html.Raw(Model.Route)
            </div>
            <div class="posted-date">
                @{
                    if (Model.Duration > 1)
                    {
                    <span>С&nbsp;</span>@Model.StartDate.ToString("d")<span>&nbsp;по&nbsp;</span>@Model.EndDate.ToString("d")
                    }
                    else
                    {
                    @Model.StartDate.ToString("d")
                    }
                }
            </div>
        </div>
        <div class="post-body">
            @Html.Raw(Model.Description)
        </div>
        @{if (Model.Reports.Where(r => r.Published).ToList().Count > 0)
          {
            <div class="row">
                <span>Отчеты:</span>
                <ul>
                @{foreach (var report in Model.Reports.Where(r => r.Published).ToList())
                  {
                        <li>@Html.ReportLink(report)</li>
                  }
                }
                </ul>
            </div>
          }
        }
        @{if (Model.PhotoAlbums.Where(a => a.Published && a.Items.Count > 0).ToList().Count > 0)
            {
            <div class="row">
                <span>Фотоальбомы:</span>
            <br>
                @{foreach (var album in Model.PhotoAlbums.Where(a => a.Published && a.Items.Count > 0))
                    {
                        <div class="post-album active">
                            <div class="row">
                                @Html.PhotoAlbumLink(album)
                            </div>
                            @{ var href = album.Href(Url); }
                            <div class="row">
                                <a href="@href">
                                    <img src="@album.Items.First().Middle" border="0" />
                                </a>
                            </div>
                        </div>
                    }
                }
            </div>
            }
        }
    </div>
    @Html.Partial("_DisqusComment")
</div>
